package com.zone.lib.download.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.util.Log;

import com.zone.lib.download.cons.Constants;


/**
 * <pre>
 * @author w-b.neu
 * </pre>
 */
public class ServiceReceiver  extends BroadcastReceiver {
    public static final String TAG=ServiceReceiver.class.getName();
    @Override
    public void onReceive(Context context, Intent intent) {
        Log.d(TAG, "onReceive:"+intent.getAction());
        if (intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED)) {
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
//                context.startForegroundService(new Intent(context, StoreService.class));
            } else {
//                context.startService(new Intent(context, StoreService.class));
            }
        }else if (intent.getAction().equals(Constants.INSTALL_JINGDONG_ACTION)){
//            String event = intent.getStringExtra("event");
//            String appId = intent.getStringExtra("appId");
//            String appType = intent.getStringExtra("appType");
//            Log.d(TAG, "onReceive jd: event="+event+" appId="+appId+" appType="+appType);
        }
    }
}
